package com.demo.jenkins;

public class MyThread extends Thread {

    public MyThread(String name){
        super(name);
    }


    @Override
    public void run() {
        //从父线程取出threadLocal的值
        try {
            Thread.sleep(1000);
            String s = ThreadLocalUtil.get();
            System.out.println(Thread.currentThread().getName() + "线程获取的值是：" + s);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
